<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>hello</title>
    <!-- 导入vue包 -->
    <script src="./lib/vue2.6.10.js"></script>
</head>
<body>
    <div id="app">
        <p>{{msg}}</p>
    </div>


    <script>
        // 创建一个vue实例
        var vm = new Vue({
            el:'#app', // 当前new的这个vue实例要控制的DOM
            data:{     // 所有的数据
                msg: "hello"
            },
            methods: {
                show(){
                    console.log('hello');
                }
            },

            // 生命周期方法
            beforeCreate() {
                console.log('beforeCreate ' + this.msg);
                
            },
            created() {
                console.log('created ' + this.msg);
            },
            beforeMount() {
                console.log("beforeMount " + document.getElementById('app').innerHTML);
            },
            mounted() {
                console.log("mounted " + document.getElementById('app').innerHTML);  
            },
            beforeUpdate() {
                console.log("beforeUpdate " + document.getElementById('app').innerHTML);  
                
            },
        })

    </script>
</body>
</html>